package com.ruoyi.swla2.service.impl;

import com.ruoyi.swla2.domain.Warn;
import com.ruoyi.swla2.domain.WarnHistory;
import com.ruoyi.swla2.mapper.WarnHistoryMapper;
import com.ruoyi.swla2.mapper.WarnMapper;
import com.ruoyi.swla2.service.IWarnHistoryService;
import com.ruoyi.swla2.service.IWarnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 告警Service业务层处理
 * 
 * @author gdqt
 * @date 2023-09-11
 */
@Service
public class WarnHistoryServiceImpl implements IWarnHistoryService
{
    @Autowired
    private WarnHistoryMapper warnHistoryMapper;

    /**
     * 查询告警
     * 
     * @param ID 告警主键
     * @return 告警
     */
    @Override
    public WarnHistory selectWarnByID(Long ID)
    {
        return warnHistoryMapper.selectWarnByID(ID);
    }

    /**
     * 查询告警列表
     * 
     * @param warn 告警
     * @return 告警
     */
    @Override
    public List<WarnHistory> selectWarnList(WarnHistory warn)
    {
        return warnHistoryMapper.selectWarnList(warn);
    }

    /**
     * 新增告警
     * 
     * @param warn 告警
     * @return 结果
     */
    @Override
    public int insertWarn(WarnHistory warn)
    {
        return warnHistoryMapper.insertWarn(warn);
    }

    /**
     * 修改告警
     * 
     * @param warn 告警
     * @return 结果
     */
    @Override
    public int updateWarn(WarnHistory warn)
    {
        return warnHistoryMapper.updateWarn(warn);
    }

    /**
     * 批量删除告警
     * 
     * @param IDs 需要删除的告警主键
     * @return 结果
     */
    @Override
    public int deleteWarnByIDs(Long[] IDs)
    {
        return warnHistoryMapper.deleteWarnByIDs(IDs);
    }

    /**
     * 删除告警信息
     * 
     * @param ID 告警主键
     * @return 结果
     */
    @Override
    public int deleteWarnByID(Long ID)
    {
        return warnHistoryMapper.deleteWarnByID(ID);
    }
}
